Ext.define('AmpleHarvest.objects.groups.cGroupDetails',
{
	extend			: 'Ext.panel.Panel',
	alias			: 'widget.ampleharvest-objects-groups-cgroupdetails',
	requires		:
	[
			"AmpleHarvest.objects.groups.window.cDetailView"
	],
	anchor			: '100% 100%',
	layout			: 'border',
	listeners		:
	{
		loadDetails : function(obj)
		{
			console.log('event Bubbled');
		}
	},
	
	initComponent	: function()
	{
		var obj_This = this;

//		this.m_obj_Events = Ext.create(
//				"AmpleHarvest.objects.groups.eventHandler.cWindowEvents",
//				{
//					m_obj_MsgBus	: m_obj_AmpleHarvest_ViewPort,
//					m_obj_Desktop	: m_obj_AmpleHarvest_ViewPort.m_obj_Layout.get_ContentWin()
//				}
//		);
		
		this.m_obj_ListView = Ext.create('AmpleHarvest.objects.groups.window.cListView',
				{
					flex	: 1,
					region	: "north"
				});
		
		this.m_obj_DetailView = Ext.create(
				"AmpleHarvest.objects.groups.window.cDetailView",
				{
					flex	: 1,
					region	: "center"
				}
		);
	
		this.m_obj_ListView.getSelectionModel().on('selectionchange', function(sm, selectedRecord) {
	        if (selectedRecord.length) {
	        	
	        	m_obj_AmpleHarvest_ViewPort
				.fireEvent(
						AmpleHarvest.objects.groups.eventHandler.cWindowEvents.C_STR_EVENT_DETAILS_LOAD,
						selectedRecord[0].data
				);
	        }
	    });
		
		this.items =
			[
				this.m_obj_DetailView
			]
	
		this.callParent();
		
		this.add(this.m_obj_ListView);
	},
	
	update_store 	: function(options)
	{
		this.m_obj_ListView.update_store(options);
	}
});